import request from '@/utils/request'

export function login(data) {
  return request({
    url: 'sys/login',
    method: 'post',
    params: {
      username: data.username,
      password: data.password,
    }
  })
}

export function getInfo(token) {
  return request({
    url: '/sys/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/sys/logout',
    method: 'post'
  })
}

export function updatePassword(form) {
  return request({
    url: '/user/updatePassword',
    method: 'put',
    params:{userID:form.id,newPassword:form.newPwd},
  })
}
